package com.nasa.sentinel;

import cn.hutool.extra.spring.SpringUtil;
import com.nasa.sentinel.handler.GlobalBlockExceptionHandler;
import com.nasa.sentinel.nacos.SentinelNacosDataSourceConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * <p>sentinel data source auto configuration</p >
 *
 * @author youyoukele
 * @version 1.0
 * @date 2021/10/12
 */
@Configuration
@Import({SpringUtil.class, SentinelNacosDataSourceConfiguration.class})
@AutoConfigureAfter({SentinelNacosDataSourceConfiguration.class})
public class SentinelDataSourceAutoConfiguration {

    @Bean
    public GlobalBlockExceptionHandler blockExceptionHandler() {
        return new GlobalBlockExceptionHandler();
    }

}
